﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using AttributesClassNameSpace;
using UtilityClassLIB;

namespace AAttributeServiceLibrary1
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together.
    public class AttributeService1 : IAttributeService1
    {

        AttributesClass attribute_obj = new AttributesClass();
        UtilityClass utility_obj = new UtilityClass();

        public DataTable FillDataTable(string dtb)
        {    //creates attributeclass object
            DataTable dt = new DataTable(); //creates datatable object to hold attribute table info
            dt = utility_obj.fillDataTable(dtb);//calls filldataTable method from Attribute Class
            return dt; //returns the datatable to the .xaml.cs 
        }

        public DataRow[] SearchAttributebyName(string attributename)
        {
            DataRow[] row_result = attribute_obj.SearchAttributebyName(attributename);
            return row_result;
        }

        public string InsertRowinAttributeTable(string an, string at, string adp, string ad)
        {
            string dbt = "tbAttributes";
            string results = attribute_obj.InsertRowinAttributeTable(an, at, adp, ad, dbt);
            return results;
        }

        public string EditRowinAttributeTable(string aid, string an, string at, string ad, string adp)
        {

            string results = attribute_obj.EditRowinAttributeTable(aid, an, at, adp, ad);
            return results;
        }

        
        
    }
}
